package cn.group.hotel2.controller;

import cn.group.hotel2.pojo.dto.RoleAddNewDTO;
import cn.group.hotel2.pojo.entity.PermissionTreeEntity;
import cn.group.hotel2.pojo.vo.PermissionTreeVO;
import cn.group.hotel2.service.IPermissionService;
import cn.group.hotel2.service.IRoleService;
import cn.group.hotel2.utils.PageResult;
import cn.group.hotel2.utils.PageUtil;
import cn.group.hotel2.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 权限控制器
 *
 * @author Edgar
 * @version 1.0.0
 * @date 2022/11/30
 */
@Slf4j
@Api(tags = "权限管理")
@RestController
@RequestMapping("/permission")
public class PermissionController {

    @Autowired
    private IPermissionService permissionService;


    @ApiOperation("权限树")
    @ApiOperationSupport(order = 400)
    @GetMapping("/tree")
    public JsonResult<PermissionTreeVO<PermissionTreeEntity>> list(){
        PermissionTreeVO treeVO = permissionService.permissionTree();
        return JsonResult.ok(treeVO);
    }
}
